package ooad.nextgen.domain;

import java.util.HashMap;
import java.util.Map;

public class ProductCatalog {
	private ItemId id1 = new ItemId(1001);
	private ItemId id2 = new ItemId(1002);
	private ItemId id3 = new ItemId(1003);
	private ItemId id4 = new ItemId(1004);
	private ItemId id5 = new ItemId(1005);

	private Map<ItemId, ProductDescription > descriptions = new HashMap<ItemId, ProductDescription>();
	public ProductCatalog(){
		Money price1= new Money(10);
		Money price2= new Money(15);
		Money price3 = new Money(8);
		Money price4= new Money(70);
		Money price5 = new Money(10);
		ProductDescription desc;
		desc = new ProductDescription(id1,price1,"soap");
		descriptions.put(id1, desc);
		desc = new ProductDescription(id2,price2,"toothbrush");
		descriptions.put(id2, desc);
		desc = new ProductDescription(id3,price3,"milk");
		descriptions.put(id3, desc);
		desc = new ProductDescription(id4,price4,"dress");
		descriptions.put(id4, desc);
		desc = new ProductDescription(id5,price5,"tea");
		descriptions.put(id5, desc);
	}
	public ProductDescription getProductDescription(ItemId id) {
		return descriptions.get(id);
	}
	public Map<ItemId, ProductDescription> getDescriptions() {
		return descriptions;
	}
	public ItemId getItemId(int id) {
		if (id == 1001) {
			return id1;
		} 
		else if(id == 1002) {
			return id2;
		}
		else if(id == 1003) {
			return id3;
		}
		else if(id == 1004) {
			return id4;
		}
		else if(id == 1005) {
			return id5;
		}
		else{
			return null;
		}
	}	
}
